package com.ruoyi.decision.service.impl;

import java.util.List;
import java.util.Locale;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.decision.mapper.TaskStrategyModelMapper;
import com.ruoyi.decision.domain.TaskStrategyModel;
import com.ruoyi.decision.service.ITaskStrategyModelService;

/**
 * 决策方案与优化策略与优化模型中间Service业务层处理
 * 
 * @author zbw
 * @date 2022-08-24
 */
@Service
public class TaskStrategyModelServiceImpl implements ITaskStrategyModelService 
{
    @Autowired
    private TaskStrategyModelMapper taskStrategyModelMapper;

    /**
     * 查询决策方案与优化策略与优化模型中间
     * 
     * @param id 决策方案与优化策略与优化模型中间主键
     * @return 决策方案与优化策略与优化模型中间
     */
    @Override
    public TaskStrategyModel selectTaskStrategyModelById(String id)
    {
        return taskStrategyModelMapper.selectTaskStrategyModelById(id);
    }

    /**
     * 查询决策方案与优化策略与优化模型中间列表
     * 
     * @param taskStrategyModel 决策方案与优化策略与优化模型中间
     * @return 决策方案与优化策略与优化模型中间
     */
    @Override
    public List<TaskStrategyModel> selectTaskStrategyModelList(TaskStrategyModel taskStrategyModel)
    {
        return taskStrategyModelMapper.selectTaskStrategyModelList(taskStrategyModel);
    }

    /**
     * 新增决策方案与优化策略与优化模型中间
     * 
     * @param taskStrategyModel 决策方案与优化策略与优化模型中间
     * @return 结果
     */
    @Override
    public int insertTaskStrategyModel(TaskStrategyModel taskStrategyModel)
    {
        String id = UUID.randomUUID().toString().toLowerCase(Locale.ROOT).replace("-","");
        taskStrategyModel.setId(id);
        return taskStrategyModelMapper.insertTaskStrategyModel(taskStrategyModel);
    }

    /**
     * 修改决策方案与优化策略与优化模型中间
     * 
     * @param taskStrategyModel 决策方案与优化策略与优化模型中间
     * @return 结果
     */
    @Override
    public int updateTaskStrategyModel(TaskStrategyModel taskStrategyModel)
    {
        return taskStrategyModelMapper.updateTaskStrategyModel(taskStrategyModel);
    }

    /**
     * 批量删除决策方案与优化策略与优化模型中间
     * 
     * @param ids 需要删除的决策方案与优化策略与优化模型中间主键
     * @return 结果
     */
    @Override
    public int deleteTaskStrategyModelByIds(String[] ids)
    {
        return taskStrategyModelMapper.deleteTaskStrategyModelByIds(ids);
    }

    /**
     * 删除决策方案与优化策略与优化模型中间信息
     * 
     * @param id 决策方案与优化策略与优化模型中间主键
     * @return 结果
     */
    @Override
    public int deleteTaskStrategyModelById(String id)
    {
        return taskStrategyModelMapper.deleteTaskStrategyModelById(id);
    }
}
